import numpy as np
a = np.array([[1,3,1,1/3],
              [1/3,1,1/2,1/5],
              [1,2,1,1/3],
              [3,5,3,1]
             ])
w = np.linalg.eig(a)
tzz = np.max(w[0])
t = np.argwhere(w[0] == tzz)
tzx = w[1][::-1,t[0]]
RILIST = [0,0,0.58,0.9,1.12,1.24,1.32,1.41,1.45,1.49,1.52,1.54,1.56,1.58,1.59]
n = a.shape[0]
RI = RILIST[n]
CI = (tzz - n) / (n - 1)
CR = CI / RI
print(CR)
print("通过一致性检验") if CR < 0.1 else print("没有通过一致性检验")

P = np.array([[8,7,6,8],
              [7,8,8,7],
              ]
            )
quan = np.zeros((n,1))
quan = tzx / sum(tzx)
Q = quan

score = np.dot(P,Q)
for i in range(len(score)):
    print("对象{:}得分={:}".format(i + 1,score[i,0].real))
